package com.comet.service.impl;

import com.comet.domain.Course;
import com.comet.mapper.CourseMapper;
import com.comet.service.CourseService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

@Service
public class CourseServiceImpl implements CourseService {

    @Resource
    private CourseMapper courseMapper;

    @Override
    public Course findById(int courseId) {
        return courseMapper.findById(courseId);
    }

    @Override
    public int saveVideo(Course course) {
        return courseMapper.saveCourse(course);
    }

    @Override
    public int deductStockBySkuId(Integer skuId, Integer num) {
        return courseMapper.deductStockBySkuId(skuId, num);
    }

    @Override
    public void addCourse(Course course) {
        courseMapper.addCourse(course);
    }

}
